﻿<controls:ChildWindow xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"  
            x:Class="MyFloridaHouse.SilverlightOpenDistricts.xDistrictNonContiguous"
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
           xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
           Width="400" Height="300" 
           Background="{StaticResource MainPageBackgroundBrush}"
           Title="Non-Contiguous Districts">
    
    <Grid x:Name="LayoutRoot" Margin="2">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>

        <Grid.ColumnDefinitions>
            
            
        </Grid.ColumnDefinitions>
        <Button x:Name="CancelButton" Content="Cancel" Click="CancelButton_Click" Width="75" Height="23" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="5" Grid.Row="0" />

        <ListBox Grid.Row="1" Grid.Column="0" Margin="0"  
                                     ItemsSource="{Binding nonContiguousDistrictList}"  
                                     ScrollViewer.VerticalScrollBarVisibility="Visible" 
                                     Background="Azure"  
                                     >
            <ListBox.ItemsPanel>
                <ItemsPanelTemplate>
                    <StackPanel Grid.Row="0" Width="202" UseLayoutRounding="True"  Background="{StaticResource MainPageBackgroundBrush}" />
                </ItemsPanelTemplate>
            </ListBox.ItemsPanel>

            <ListBox.ItemTemplate>
                <DataTemplate  >
                    <Border BorderThickness="1" BorderBrush="AntiqueWhite"  >
                        <Button x:Name="btn_JumpToNonContiguousdistrict"  Width="25" Click="btn_SelectNonContiguousdistrict_Click"  Tag="{Binding}" >
                            <Button.Content >
                                <Border Width="25" Background="{Binding fillColorBrush}">
                                    <sdk:Label Content="{Binding districtID}" Style="{StaticResource LabelStyle}"></sdk:Label>
                                </Border>
                            </Button.Content>
                        </Button>
                    </Border>
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>

    </Grid>
</controls:ChildWindow>